import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const state = {
    sid:'',
    uid:'',
    username:'',



    fromname: '',
    toname:'',
    content:'',
    filebase64:'',
    file:'',
    

    allfile:'',
    fid:'',
    cid:'',

}
const getter={

}

const mutations = {
    saveUserInfo(state,obj){
        state.sid=obj.sid
        state.uid=obj.uid
        state.username=obj.username
    },
    saveCardInfo(state,obj){
        state.fromname=obj.fromname
        state.toname=obj.toname
        state.content=obj.content
        state.filebase64=obj.imgurl
        console.log(obj)
    },
    saveCardIdent(state,obj){
        state.pid=obj.pid
        state.tid=obj.tid
    },
}

const actions = {

}
const store = new Vuex.Store({
    state,
    mutations
})

export default store